import React from 'react';
import { message,Button } from 'antd';
import { ModalForm, ProFormText, ProFormSelect, ProFormTextArea, ProFormDigit } from '@ant-design/pro-form';

const AddScript = () => {
  return (
    <div>
      <ModalForm
        layout='horizontal'
        labelCol={{span:4}}
        wrapperCol={{span:14}}
        title="编辑话术"
        trigger={
          <Button type="primary">+ 添加话术</Button>
        }
        onFinish={async (values) => {
          console.log(values);
          message.success('提交成功');
          // 刷新
          // ref.current.reset();
          return true;
        }}
      >
        <ProFormSelect
          name="select"
          label="话术分类"
          valueEnum={{
            value1:'话术分类'
          }}
          placeholder="Please select a country"
          rules={[{ required: true, message: '请选择话术分类' }]}
        />
        <ProFormText
          width="md"
          name="sctitle"
          label="话术标题"
          placeholder="请输入话术标题"
        />
        <ProFormTextArea
          name="sctext"
          label="话术内容"
          placeholder="请输入话术内容"
        />
        <ProFormDigit
          width={100}
          name="scsort"
          label="排序"
        />
      </ModalForm>
    </div>
  );
};

export default AddScript;
